<?php
$page->BodyId = 'edit_smiley';
$page->BodyClass = '';
$page->Section = '';

$page->SetWrapperFile('_wrapper');

?>

<div class="cms">
<? if ( $page->Message ): ?>
	<p>
		<?=$page->Message?>
	</p>
<? endif ?>

<? if ( $page->Error ): ?>
	<p class="error">
		<?=$page->Error?>
	</p>
<? endif ?>

<? if ( !$page->Smiley ): ?>
	<p>Smiley not found</p>
<? else: ?>
	<div class="smiley">
		<h3>
			<a href="<?=$page->Smiley->Href()?>"><img src="<?=$page->Smiley->Url()?>" width="<?=$page->Smiley->Width()?>" height="<?=$page->Smiley->Height()?>" /></a>
		</h3>
		<form src="/smiley/edit/?smiley_id=<?=$page->SmileyId?>" method="post">
			<fieldset>
				<p class="input text">
					<label for="title">Title:</label>
					<input name="title" id="title" value="<?=$page->SmileyTitle?>" />
				</p>
				<p class="input textarea">
					<label for="description">Description:</label>
					<textarea name="description" id="description"><?=$page->SmileyDescription?></textarea>
				</p>
				<p class="input submit">
					<input type="submit" value="Submit" />
				</p>
			</fieldset>
		</form>
		<p>
			<a href="<?=$page->Smiley->SmileyUrl()?>">Back</a>
		</p>
	</div>
<? endif ?>
</div>